import { myRequest } from '../../api/myRequest'
import { actionsMap } from '../../api/url'
import parent from './parent'

const $RC = 'RoutingConfiguration'
const $RR = 'RoutingInstance'
const $RR_actions = actionsMap[$RR]

export default {
  RoutingConfiguration: {
    ...parent.Configuration($RC),
  },
  RoutingInstance: {
    ...parent.Instance($RR),
    startRouting(params) {
      let recipient = [
        { action: $RR_actions.INSTANCE_START_ROUTING, data: [{...params}] },
      ]
      return myRequest($RR, recipient)
    },
  }
}